Skip to content

refactor: extract shared filters-lib.sh for filters.ini parsing#63

Open
DmitriiAn wants to merge 1 commit into
mainfrom
refactor/shared-filters-lib
Open

refactor: extract shared filters-lib.sh for filters.ini parsing#63
DmitriiAn wants to merge 1 commit into
mainfrom
refactor/shared-filters-lib

Conversation

@DmitriiAn

Copy link
Copy Markdown
Contributor

verify-migration.sh and preflight-check.sh carried two copies of the same filters.ini logic with divergent implementations. Move the canonical, column-parameterized implementation from verify-migration.sh
into filters-lib.sh and source it from both scripts, so the parsing/scoping logic lives in one place.

No behavior change: preflight's build_schema_where/build_table_filter become schema_clause "n.nspname"/table_clause "n.nspname" "c.relname" (identical SQL), and its exclude-extension awk is replaced by the shared parser's output.

New file filters-lib.sh: the single source of truth, inheriting verify-migration.sh's implementation:

@DmitriiAn DmitriiAn requested a review from teknogeek0 June 18, 2026 10:10

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a general practice, can we move the shared libs to the top of the shell scripts? helps make them easier to track

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as other - As a general practice, can we move the shared libs to the top of the shell scripts? helps make them easier to track

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean to keep the filter code from filters-lib.sh in both scripts (verify-migration.sh and preflight-check.sh), but put it at the top instead of having a separate file for that?
I'm okay with that. I just wanted to improve the code base and make the scripts more readable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants